package com.itheima.tanhua.vo;

import com.itheima.tanhua.domain.Answer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Lff
 * @date 2022/4/8
 * 答案vo
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AnswerVo {
    private String id;//答案编号
    private String option;//答案内容

    public static AnswerVo init(Answer answer) {
        AnswerVo answerVo = new AnswerVo();
        answerVo.setId(answer.getId().toString());
        answerVo.setOption(answer.getAnswerTxt());
        return answerVo;
    }
}
